using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter27
{
	/// <summary>
	/// Example02: The Resistance of a Conductor
	/// Calculate the resistance of an aluminum cylinder that has 
	/// a length of 10.0 cm and a cross-sectional area of 
	/// 2 \times 10^{-4} m^2. Repeat the calculation for a cylinder 
	/// of the same dimensions and made of glass having 
	/// a resistivity of 3.0 \times 10^{10} \Omega m.
	/// </summary>
	public class Example02
	{
		public Example02()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Length l = new L.Length();
			l.m = 0.1;
			L.Area A = new L.Area();
			A.mSQUARE = 2.0E-4;
			//(A)
			L.Resistivity rho = new L.Resistivity();
			rho.Ohmm = 2.82E-8;
			L.Resistance R = new L.Resistance(rho,l,A);
            result+=Convert.ToString(R.Ohm)+"    ";
			//(B)
			L.Resistivity rhop = new L.Resistivity();
			rhop.Ohmm = 3.0E10;
			L.Resistance Rp = new L.Resistance(rhop,l,A);
			result+=Convert.ToString(Rp.Ohm);
		}
	}
}
